dojo.declare("MCustomerHomePg", wm.Page, {
start: function() {
this.vVendorMinAmount = 0;
this.svProjectServices.input.setValue("projectId", wm.Page.getPage("MobileMainPg").vProjectId);
this.svProjectServices.update();
},
"preferredDevice": "phone",
displayHomePg: function() {
},
listProjectServicesCustomeraddressFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
if (inValue) {
return inValue;
} else {
return "";
}
},
tbLogoutClick: function(inSender) {
this.ncLogout.update();
var mainPage = wm.Page.getPage("MobileMainPg");
mainPage.vLoginCount = mainPage.vLoginCount + 1;
wm.Page.getPage("MobileMainPg").ncLoginPg.update();
//mainPage.headerPanel.setShowing(true);
},
layerVendorItemsShow: function(inSender) {
if (wm.Page.getPage("MCustomerOrderSelectPg")) {
wm.Page.getPage("MCustomerOrderSelectPg").lvVendorItems.clearData();
wm.Page.getPage("MCustomerOrderSelectPg").lvVendorItems.update();
}
},
tbPastOrdersClick1: function(inSender) {
if (wm.Page.getPage("MCustomerOrderHistoryPg")) {
wm.Page.getPage("MCustomerOrderHistoryPg").loadHistory();
}
this.vPageBack = "CUSTOMER_HISTORY";
},
listProjectServicesSelect: function(inSender, inItem) {
this.vPageBack = "VENDORS";
// this.svProjectSvcVendors.input.setValue("projectId", wm.Page.getPage("MobileMainPg").vProjectId);
// this.svProjectSvcVendors.update();
this.layerVendors.activate();
},
layerVendorClosedShow: function(inSender) {
this.layerVendorItemsShow(inSender);
},
checkVendorShopTime: function(inSender, inItem) {
var selectedData = inSender.selectedItem.getData();
this.vVendorMinAmount = selectedData.minOrderAmt;
this.svShopTime.update();
},
svShopTimeSuccess: function(inSender, inDeprecated) {
//  alert(inSender.getData().dataValue);
var shopTime = inSender.getData().dataValue;
var index = this.listProjectServices.getSelectedIndex();
this.vPageBack = "VENDOR_ITEMS";
if (index != -1) {
var ptoVar = this.listProjectServiceVendors1.selectedItem.data.pto;
var shopTimeValue = this.listProjectServiceVendors1.selectedItem.data.shopTime;
var ptoMsg = this.listProjectServiceVendors1.selectedItem.data.ptoMessage;
if (ptoMsg === null || ptoMsg.length === 0 || ptoMsg === "") {
ptoMsg = "Shop is closed";
}
if (ptoVar) {
this.layerVendorClosed.activate();
this.labelVendorClosed.setCaption(ptoMsg);
} else {
if (shopTime) {
this.svItemCategory.update();
if (wm.Page.getPage("MCustomerOrderSelectPg")) {
wm.Page.getPage("MCustomerOrderSelectPg").layerSelectCategory.activate();
}
this.layerVendorItems.activate();
} else {
this.layerVendorClosed.activate();
this.labelVendorClosed.setCaption(ptoMsg);
}
}
}
},
backClick: function(inSender) {
if (this.vPageBack === 'VENDORS') {
this.layerServices.activate();
}
if (this.vPageBack === 'VENDOR_ITEMS') {
this.layerVendors.activate();
this.vPageBack = 'VENDORS';
}
if (this.vPageBack === 'VENDOR_ITEM_CATEGORY') {
if (wm.Page.getPage("MCustomerOrderSelectPg")) {
wm.Page.getPage("MCustomerOrderSelectPg").layerSelectCategory.activate();
}
this.vPageBack = 'VENDOR_ITEMS';
}
if (this.vPageBack === 'CHECK_OUT') {
if (wm.Page.getPage("MCustomerOrderSelectPg")) {
wm.Page.getPage("MCustomerOrderSelectPg").layerSelectOrder.activate();
}
this.vPageBack = 'VENDOR_ITEM_CATEGORY';
}
if (this.vPageBack === 'CONFIRM_ORDER') {
if (wm.Page.getPage("MCustomerOrderSelectPg")) {
wm.Page.getPage("MCustomerOrderSelectPg").refreshVendorItemList();
wm.Page.getPage("MCustomerOrderSelectPg").txtSearch.clear();
wm.Page.getPage("MCustomerOrderSelectPg").layerSelectOrder.activate();
}
this.vPageBack = 'VENDOR_ITEM_CATEGORY';
}
if (this.vPageBack === 'CUSTOMER_HISTORY') {
this.layerOrderHistory.activate();
if (wm.Page.getPage("MCustomerOrderHistoryPg")) {
wm.Page.getPage("MCustomerOrderHistoryPg").layerOrders.activate();
}
}
if (this.vPageBack === 'CUSTOMER_ACCOUNT') {
this.layerMyAccount.activate();
}
},
tbServicesClick1: function(inSender) {
this.vPageBack = "VENDORS";
},
tbUpdateAccountClick1: function(inSender) {
this.vPageBack = "CUSTOMER_ACCOUNT";
},
listProjectServicesServiceIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var buttonText = '<img src ="resources/images/mobile/next_img.png" height="26px" />';
return buttonText;
},
listProjectServiceVendorsServiceIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var buttonText = '<img src ="resources/images/mobile/next_img.png" height="26px" />';
return buttonText;
},
listProjectServiceVendors1Select: function(inSender, inItem) {
// this.listProjectServiceVendorsSelect(inSender, inItem);
},
listProjectServicesSelect1: function(inSender, inItem) {
var serviceId = this.listProjectServices.selectedItem.data.serviceId;
this.listProjectServiceVendors1.setDataSet(this.svProjectAllVendors.setQuery({
serviceId: serviceId
}));
},
svProjectAllVendorsSuccess: function(inSender, inDeprecated) {
},
_end: 0
});

MCustomerHomePg.widgets = {
vVendorId: ["wm.Variable", {"type":"NumberData"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"listProjectServiceVendors.selectedItem.customer.customerId","targetProperty":"dataSet.dataValue"}, {}]
}]
}],
ncServices: ["wm.NavigationCall", {}, {}, {
input: ["wm.ServiceInput", {"type":"gotoLayerInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"layerServices","targetProperty":"layer"}, {}]
}]
}]
}],
svProjectServices: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"getProjectServices","service":"serviceliveDB","startUpdate":true}, {}, {
input: ["wm.ServiceInput", {"type":"getProjectServicesInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"true","targetProperty":"active"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"[mobileMainPg].vProjectId.dataValue","targetProperty":"projectId"}, {}]
}]
}]
}],
vPageBack: ["wm.Variable", {"type":"StringData"}, {}],
svProjectAllVendors: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"getAllVendorsForProject","service":"serviceliveDB","startUpdate":true}, {"onSuccess":"svProjectAllVendorsSuccess"}, {
input: ["wm.ServiceInput", {"type":"getAllVendorsForProjectInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"true","targetProperty":"active"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"[mobileMainPg].vProjectId","targetProperty":"projectId"}, {}]
}]
}]
}],
svShopTime: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"getShoptimings","service":"RegistrationService"}, {"onSuccess":"svShopTimeSuccess"}, {
input: ["wm.ServiceInput", {"type":"getShoptimingsInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"listProjectServiceVendors1.selectedItem.vendorId","targetProperty":"vendorId"}, {}]
}]
}]
}],
svItemCategory: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"getVendorItemType","service":"serviceliveDB"}, {}, {
input: ["wm.ServiceInput", {"type":"getVendorItemTypeInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"listProjectServiceVendors1.selectedItem.serviceId","targetProperty":"serviceId"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"listProjectServiceVendors1.selectedItem.vendorId","targetProperty":"vendorId"}, {}]
}]
}]
}],
ncLogout: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"You have been logged Out\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"2000","targetProperty":"duration"}, {}],
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
vVendorMinAmount: ["wm.Variable", {"type":"NumberData"}, {}],
ncLogoutConfirm: ["wm.NotificationCall", {"operation":"confirm"}, {"onOk":"tbLogoutClick"}, {
input: ["wm.ServiceInput", {"type":"confirmInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"Do you want to log out ?\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"\"Yes\"","targetProperty":"OKButtonText"}, {}],
wire2: ["wm.Wire", {"expression":"\"No\"","targetProperty":"CancelButtonText"}, {}]
}]
}]
}],
ldServices: ["wm.LoadingDialog", {"caption":"Loading...Services.Please wait..","captionWidth":"100%"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire1: ["wm.Wire", {"expression":undefined,"source":"lvProjectServices","targetProperty":"serviceVariableToTrack"}, {}],
wire: ["wm.Wire", {"expression":undefined,"source":"layoutBox","targetProperty":"widgetToCover"}, {}]
}]
}],
ldProjectServiceVendor: ["wm.LoadingDialog", {"caption":"Loading...Vendors","captionWidth":"200px","serviceVariableToTrack":["svProjectAllVendors"]}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"layoutBox","targetProperty":"widgetToCover"}, {}]
}]
}],
ldShoptime: ["wm.LoadingDialog", {"captionWidth":"100%","serviceVariableToTrack":["svShopTime"]}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"layoutBox","targetProperty":"widgetToCover"}, {}]
}]
}],
layoutBox: ["wm.Layout", {"horizontalAlign":"center","styles":{},"verticalAlign":"top"}, {}, {
panel5: ["wm.Panel", {"borderColor":"#e61818","height":"45px","horizontalAlign":"center","layoutKind":"left-to-right","styles":{},"verticalAlign":"middle","width":"100%"}, {}, {
picture5: ["wm.Picture", {"aspect":"v","height":"38px","source":"resources/images/mobile/h2m_back.png","styles":{},"width":"80px"}, {"onclick":"backClick"}],
panel7: ["wm.Panel", {"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, {
picture6: ["wm.Picture", {"aspect":"v","height":"100%","source":"resources/images/mobile/h2m_header_sub.png","styles":{},"width":"100%"}, {}]
}],
panel6: ["wm.Panel", {"height":"35px","horizontalAlign":"right","verticalAlign":"top","width":"40px"}, {}, {
picture7: ["wm.Picture", {"aspect":"v","height":"100%","source":"resources/images/mobile/logout.jpg","width":"50px"}, {"onclick":"ncLogoutConfirm"}]
}]
}],
mainLayers: ["wm.Layers", {"border":"0,0,0,0","borderColor":"","defaultLayer":0,"minDesktopHeight":300,"minHeight":300,"styles":{},"transition":"fade"}, {}, {
layerServices: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"layer1","horizontalAlign":"center","styles":{},"themeStyleType":"ContentPanel","verticalAlign":"top"}, {}, {
panelServicesList2: ["wm.Panel", {"autoScroll":true,"borderColor":"","height":"100%","horizontalAlign":"center","layoutKind":"left-to-right","styles":{},"verticalAlign":"top","width":"100%"}, {}, {
listProjectServices: ["wm.List", {"_classes":{"domNode":["MobileListStyle"]},"borderColor":"","columns":[
{"show":false,"field":"PHONE COLUMN","title":"-","width":"100%","align":"left","expression":"","mobileColumn":false},
{"show":false,"field":"serviceName","title":"ServiceName","width":"100%","align":"center","formatFunc":"","editorProps":null,"mobileColumn":true},
{"show":false,"field":"serviceId","title":"ServiceId","width":"30px","align":"right","formatFunc":"listProjectServicesServiceIdFormat","mobileColumn":true}
],"headerVisible":false,"height":"100%","isNavigationMenu":true,"margin":"0,2,0,0","minHeight":0,"minWidth":0,"padding":"0","styleAsGrid":false,"styles":{}}, {"onSelect":"listProjectServicesSelect","onSelect1":"listProjectServicesSelect1"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"svProjectServices","targetProperty":"dataSet"}, {}]
}]
}]
}]
}],
layerVendors: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"layer1","horizontalAlign":"center","styles":{},"themeStyleType":"ContentPanel","verticalAlign":"top"}, {}, {
panelServicesList: ["wm.Panel", {"autoScroll":true,"height":"100%","horizontalAlign":"center","styles":{},"verticalAlign":"top","width":"100%"}, {}, {
listProjectServiceVendors1: ["wm.List", {"_classes":{"domNode":["MobileListStyle"]},"border":"1","columns":[
{"show":false,"field":"PHONE COLUMN","title":"-","width":"100%","align":"left","expression":"","mobileColumn":false},
{"show":false,"field":"vendorName","title":"VendorName","width":"100%","align":"center","formatFunc":"","mobileColumn":true},
{"show":false,"field":"vendorId","title":"VendorId","width":"30px","align":"right","formatFunc":"listProjectServiceVendorsServiceIdFormat","mobileColumn":true},
{"show":false,"field":"serviceId","title":"ServiceId","width":"100%","align":"left","formatFunc":"","mobileColumn":false},
{"show":false,"field":"pto","title":"Pto","width":"100%","align":"left","formatFunc":"","mobileColumn":false},
{"show":false,"field":"minOrderAmt","title":"MinOrderAmt","width":"100%","align":"left","formatFunc":"","mobileColumn":false},
{"show":false,"field":"ptoMessage","title":"PtoMessage","width":"100%","align":"left","formatFunc":"","mobileColumn":false},
{"show":false,"field":"serviceName","title":"ServiceName","width":"100%","align":"left","formatFunc":"","mobileColumn":false},
{"show":false,"field":"shopTime","title":"ShopTime","width":"100%","align":"left","formatFunc":"","mobileColumn":false}
],"headerVisible":false,"height":"100%","isNavigationMenu":true,"margin":"0,2,0,0","minHeight":0,"minWidth":0,"padding":"0","styleAsGrid":false,"styles":{}}, {"onSelect":"checkVendorShopTime"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"svProjectAllVendors","targetProperty":"dataSet"}, {}]
}]
}]
}]
}],
layerOrderHistory: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"layer1","horizontalAlign":"left","styles":{},"themeStyleType":"ContentPanel","verticalAlign":"top"}, {}, {
panelServicesList1: ["wm.Panel", {"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, {
pcOrderHistory: ["wm.PageContainer", {"deferLoad":true,"pageName":"MCustomerOrderHistoryPg","subpageEventlist":{},"subpageMethodlist":{},"subpageProplist":{}}, {}]
}]
}],
layerMyAccount: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"layer1","horizontalAlign":"left","styles":{},"themeStyleType":"ContentPanel","verticalAlign":"top"}, {}, {
panelCustomerAccount: ["wm.Panel", {"height":"100%","horizontalAlign":"center","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, {
pcCustomerAccount: ["wm.PageContainer", {"deferLoad":true,"pageName":"MCustomerAccountPg","subpageEventlist":{},"subpageMethodlist":{},"subpageProplist":{}}, {}]
}]
}],
layerVendorItems: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"layer1","horizontalAlign":"left","themeStyleType":"ContentPanel","verticalAlign":"top"}, {"onShow":"layerVendorItemsShow"}, {
pcItemList: ["wm.PageContainer", {"deferLoad":true,"pageName":"MCustomerOrderSelectPg","subpageEventlist":{},"subpageMethodlist":{},"subpageProplist":{}}, {}]
}],
layerVendorClosed: ["wm.Layer", {"borderColor":"","caption":"layer1","horizontalAlign":"left","styles":{},"themeStyleType":"ContentPanel","verticalAlign":"top"}, {"onShow":"layerVendorClosedShow"}, {
panel1: ["wm.Panel", {"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"middle","width":"100%"}, {}, {
labelVendorClosed: ["wm.Label", {"align":"center","caption":"Vendor Closed","height":"200px","padding":"4","singleLine":false,"styles":{"fontWeight":"bolder","fontSize":"18px","color":"#df1f1f"},"width":"100%"}, {}]
}]
}]
}],
panel3: ["wm.Panel", {"border":"0,0,1,0","desktopHeight":"45px","dockBottom":true,"enableTouchHeight":true,"height":"45px","horizontalAlign":"center","layoutKind":"left-to-right","mobileHeight":"45px","styles":{},"verticalAlign":"bottom","width":"100%"}, {}, {
tbServices: ["wm.Button", {"border":"0,1,0,0","caption":"Services","height":"100%","imageIndex":58,"imageList":"app.silkIconList","styles":{},"width":"100%"}, {"onclick":"layerServices","onclick1":"tbServicesClick1"}],
tbPastOrders: ["wm.Button", {"border":"0,1,0,0","caption":"History","height":"100%","imageIndex":82,"imageList":"app.silkIconList","width":"100%"}, {"onclick":"layerOrderHistory","onclick1":"tbPastOrdersClick1"}],
tbUpdateAccount: ["wm.Button", {"border":"0","caption":"Account","height":"100%","imageIndex":54,"imageList":"app.silkIconList","width":"100%"}, {"onclick":"layerMyAccount","onclick1":"tbUpdateAccountClick1"}]
}]
}]
};

MCustomerHomePg.prototype._cssText = '';
MCustomerHomePg.prototype._htmlText = '';